<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>事件姓名案例</title>
    <style>
        #root {
            width: 200px;
            height: 100px;
            background-color: pink;
            margin: 0 auto;
            display: flex;
            flex-direction: column;
            justify-content: space-between;
        }
    </style>
    <script src="../../js/vue.js"></script>
</head>
<body>
<div id="root">
    <label>
        姓<input type="text" v-model="firstName">
    </label>
    <label>
        名<input type="text" v-model="lastName">
    </label>
    <div>你的全名是:<span>{{firstName.slice(0, 3)}}{{lastName}}</span></div>
</div>
<script>
    new Vue({
        el: '#root',
        data: {
            firstName: '张',
            lastName: '三',
        }
    })
</script>
</body>
</html>